<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>采购询价详情</title>
    <link href="/res/css/respective/priceAsk/buyer.css" rel="stylesheet">
    <script src="/res/js/common/jquery.1.9.1.min.js"></script>
</head>
<body>
[#assign  menucode ="myProject"]
<div class="warp">
[#include "/front/common/front_headAzt.html"]
    <div class="backcontent">
    [#include "/front/common/front_leftAzt.html"]
        <div class="back-main">
            <div class="mainContent">
                <div class="mainContentWhite">
                    <h1>采购询价报价详情</h1>
                    <label class="opDetail" style="text-align: right; float: right;">
                        <a href="/enquiry/project/detail/p/${enq.projectId}/t/2">返回项目</a></label>
                    <hr>
                    <h2>基本信息</h2>
                    <div class="baseInfo">
                        <div>
                            <dfn> 询价名称：<span class="ellipsis">${enq.enquiryName!}  </span> </dfn> <dfn> 发布公司：<span>${enq.companyName!}  </span> </dfn>
                        </div>
                        <div>
                            <dfn> 项目名称：<span>${enq.enqProject.projectName!}  </span> </dfn> <dfn> 支付方式：<span>${enq.paymentStr!}  </span> </dfn>
                        </div>
                        <div>
                            <dfn> 客户名称：<span>${(enq.enqProject.customerName)!}  </span> </dfn> <dfn> 项目所在地：<span>${(enq.enqProject.getAddressName("-"))!}</span> </dfn>
                        </div>
                        <div>
                            <dfn> 是否含税：<span>[#if enq.taxPrice==3 ]不含[#else]含税${enq.taxInstro!0}%[/#if]  </span> </dfn> <dfn> 是否含运费：<span>${(enq.shipPrice==1)?string("含运费","不含运费")}  </span> </dfn>
                        </div>
                        <div>
                            <dfn> 质保要求：<span>[#if enq.quality?? ]${enq.quality}年[#else]${enq.guaranteeinfo!} [/#if] </span> </dfn> <dfn>
                            [#if enq.attachfile?? && enq.attachfile!=""]
                            附件： <span><a href="${enq.attachfile!}"  target="_blank">附件下载</a></span> </dfn>
                            [/#if]
                        </div>
                    </div>
                    <hr style="margin-bottom: 15px;">
                    <div class="othNed">
                        <label style="color: #999999">其他要求：</label>
                             ${enq.otherRemarks!}
                     </div>
                    <h2>供应商报价
                        <small class="itermTip">
                            <em style="vertical-align: middle;"> 产品类目：</em>
                            <div class="ppSelect" style="display: inline-block;background: url(/res/images/checkBoxRadio/blueSelect_03.jpg) right center no-repeat;height: 20px;">
                                <select id="so_companyname" style="height: 100%; border: none;background: none;">
                                    <option value="0">所有目录</option>
                                [#list encats as cat ]
                                    <option value="${cat.categoryId}">${cat.categorName}</option>
                                [/#list]
                                </select>
                            </div>
                        </small>
                    </h2>
                    <table class="table noBorder">
                        <thead>
                        <tr>
                            <th style="width: 10%;">
                                <label> <input id="checkall" type="checkbox"/><em style="vertical-align: middle;margin-left: 5px;">全选</em> </label>
                            </th>
                            <th style="width: 20%;">供应商</th>
                            <th style="width: 10%;">报价数量</th>
                            <th style="width: 15%;">清单报价</th>
                            <th style="width: 10%;">税率</th>
                            <th style="width: 25%;">报价系统</th> 
                            <th style="width: 10%;">操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        [#list quotes as quote ]
                        <tr attrids="${quote.categoryIds!}" class="q_tr">
                            <td><input class="quotec" type="checkbox" value="${quote.quoteId}"/></td>
                            <td>[#--<a class="bugetTypeIcon" style="margin-right:20px;margin-left: 0px;">集</a>--]
                                <small style="font-size: 14px;vertical-align: middle;">${quote.companyName!}</small>
                            </td>
                            <td>${quote.quantity!}</td>
                            <td class="contentBold">￥${quote.totalprice!0}</td>
                            <td>${quote.taxInstro}%</td>
                            <td>${quote.categroyNames!}</td> 
                            <td style="border-right: 1px solid #e9e9e9;">
                                [#if quote.quantity!=0 ]
                                <a href="/enquiry/purchase/quote/detail/item/${quote.quoteId}">报价清单</a>
                                [/#if]
                            </td>
                        </tr>

                        [/#list]</tbody>
                        <tfoot>
                        <tr>
                            <td colspan="8" style="padding: 15px 0;">
                                [#if user.id == enq.userId ]
                                <button onclick="downquote()" class="backButt" type="button">下载报价清单</button>
                                [/#if]

                                [#if user.id == enq.userId  && enq.state==1 ]
                                <button onclick="gobudget(${enqid})" class="backButt" style="float: right;width: 100px;" type="button">去比价</button>
                                [/#if]
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
        <!-- 底部菜单-->
    [#include "/front/common/front_footerAzt.html"]
    </div>

</div>

<script src="/res/js/common/common.js"></script>
<script src="/res/third/layer/layer.js"></script>
<script src="/res/third/layer/layer.extends.js"></script>
<script src="/res/js/common/jquery.ellipsis.js"></script>
<script type="text/javascript">
$(function(){
	$(".ellipsis").ellipsis({maxWidth:290,maxLine:1});
});
    $("#allcats").on("change", function () {
        var trobj = $(this);
        var v = trobj.val();
        //筛选
        $(".q_tr").each(function () {
            if (v == 0) {
                trobj.show();
                return true;
            }

            var idstr = $(this).attr("attrids");
            var ids = idstr.split(",");
            if ($.inArray(v, ids) == -1) {
                trobj.hide();
            } else {
                trobj.show();
            }
        })
    });

    function downquote() {
        var ids = [];
        $(".quotec:checked").each(function () {
            ids.push($(this).val());
        });
        if (ids.length == 0) {
            layer.msgShort("至少选择一个公司!")
        } else {
            location.href = "/enquiry/quote/download/" + ids.join(",");
        }
    }

    /*预算清单*/
    function gobudget(enqid) {
        var ids = [];
        $(".quotec:checked").each(function () {
            ids.push($(this).val());
        });
        if (ids.length < 2) {
            layer.msgShort("至少选择两家公司!")
        } else {
            location.href = "/enquiry/budget/purchase/create/"+enqid+"/" + ids.join(",");
        }
    }

    $("#checkall").click(function () {
        var obj = $(this);
        $(".quotec").each(function () {
            $(this)[0].checked = obj.is(":checked");
        })
    });

</script>
</body>
</html>
